SMSGatewayHub API v1

SMSGatewayHub Developer API

Complete reference for sending bulk SMS, OTP, Voice calls, and managing delivery reports via our REST API. Supports HTTP GET, JSON POST, and XML POST formats.

200 RPSStandard throughput
🚀
2000 TPSHA Cluster available
🔐
SSL/TLSEnd-to-end encryption
🌍
GlobalInternational SMS supported

Authentication

Every API request requires your unique APIKey parameter. Your API key is available in your SMSGatewayHub account dashboard under API Settings.

💡 Keep your APIKey private. Never expose it in client-side JavaScript or public repositories.
ParameterTypeDescription
APIKeyrequired string Your unique API key assigned to your account

Optionally, restrict API access to specific IP addresses from your account dashboard for additional security.

Throughput & SLA

Standard
200 RPS
Response time: 100–500 ms
HA Cluster
2000 TPS
Response time: 50–150 ms

To upgrade to the HA Cluster infrastructure for higher throughput requirements, contact support@smsgatewayhub.com

Security

All API endpoints are hosted on Cloudflare's serverless environment with SSL/TLS encryption. Additional layers include a Web Application Firewall (WAF), IP-based restrictions, and brute-force monitoring on all dedicated servers.

Data Retention Policy

Client TypeRetention Period
Banking clients1 year (as per RBI regulations)
All other clients6 months, then archived to cold storage (S3)

🧪 Live API Tester

Test the SMSGatewayHub API directly from your browser. Enter your credentials and send a real SMS to verify your integration.

🧪

Interactive API Tester

Fill in the fields below and click "Send SMS" to test live

0 characters · 0 SMS

Request URL Preview

Fill in the fields above to see the API URL...
200 OK
⚠️ This tester makes real API calls and will deduct credits from your account.
Don't have an account? Register for free →
GET

Single SMS API

Send a single SMS to one recipient. Supports Text, OTP, Unicode, Flash, Group, and Scheduled delivery.

GET https://www.smsgatewayhub.com/api/mt/SendSMS

Parameters

ParameterTypeDescription
APIKeyrequiredstringAPI key for authentication
senderidrequiredstringDLT-approved sender ID (6 characters)
channelrequiredstring1=Promotional, 2=Transactional, OTP=OTP, INT=International
DCSstring0=Normal/English (default), 8=Unicode (Hindi/Regional)
flashsmsstring0=Normal SMS (default), 1=Flash SMS (immediate popup)
numberrequiredstringRecipient mobile number with country code (e.g. 91989xxxxxxx)
textrequiredstringSMS message content (URL-encode special characters)
routestringRoute ID to control delivery path
schedtimestringScheduled send time — format: yyyy/mm/dd hh:mm:ss PM
groupidstringContact group ID
EntityIdrequiredstringDLT-registered Entity ID
dlttemplateidrequiredstringDLT-registered Template ID

Request Examples

https://www.smsgatewayhub.com/api/mt/SendSMS
  ?APIKey=yourapicode
  &senderid=TESTIN
  &channel=2
  &DCS=0
  &flashsms=0
  &number=91989xxxxxxx
  &text=test+message
  &route=1
  &EntityId=Registered-Entity-Id
  &dlttemplateid=Registered-DLT-Template-Id

Response

{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047",
"MessageData":[{"Number":"91989xxxxxxx","MessageId":"BqTiw66A2UGLFV3DnwHFLQ"}]}
GET

Bulk SMS API

Send SMS to multiple recipients simultaneously. Pass multiple numbers as comma-separated values in the number parameter. All other parameters are identical to Single SMS API.

GET https://www.smsgatewayhub.com/api/mt/SendSMS
💡 Separate multiple numbers with commas: number=91989xxxxxxx,91999xxxxxxx,91888xxxxxxx

Example

https://www.smsgatewayhub.com/api/mt/SendSMS
  ?APIKey=yourapicode
  &senderid=TESTIN
  &channel=2
  &DCS=0
  &flashsms=0
  &number=91989xxxxxxx,91999xxxxxxx
  &text=test+message
  &route=1
  &EntityId=Registered-Entity-Id
  &dlttemplateid=Registered-DLT-Template-Id

Response

{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047",
"MessageData":[
  {"Number":"91989xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},
  {"Number":"91999xxxxxxx","MessageId":"PfivClgH20iG6G5R3usHwA"}
]}
GET

International SMS API

Send SMS to international numbers worldwide. Use channel=INT and pass the full number with country code (without + prefix).

GET https://www.smsgatewayhub.com/api/mt/SendSMS
⚠️ For international SMS, EntityId and dlttemplateid are NOT required.

Example

https://www.smsgatewayhub.com/api/mt/SendSMS
  ?APIKey=yourapicode
  &senderid=TESTIN
  &channel=INT
  &DCS=0
  &flashsms=0
  &number=12093158246
  &text=test+message
  &route=1
GET

Balance Check API

Check available SMS credits in your account in real-time.

GET https://www.smsgatewayhub.com/api/mt/GetBalance?APIKey=yourapicode

Response

{"ErrorCode":"0","ErrorMessage":"Success","Balance":"Unified Response:9988"}
GET

DLR Status API

Check the delivery status of a sent message using the jobid returned from the Send SMS API response.

GET https://www.smsgatewayhub.com/api/mt/GetDelivery?APIKey=yourapicode&jobid=#######
ParameterTypeDescription
APIKeyrequiredstringAPI key for authentication
jobidrequiredstringJob ID from the Send SMS API response

Response

{"ErrorCode":"0","ErrorMessage":"Success","MessageId":null,
"DeliveryReports":[
  {"MessageId":"mvHdpSyS7UOs9hjxixQLvw","DeliveryStatus":"Delivered","DeliveryDate":"2025-09-28T06:17:00"},
  {"MessageId":"PfivClgH20iG6G5R3usHwA","DeliveryStatus":"Delivered","DeliveryDate":"2025-09-28T06:17:00"}
]}
POST

JSON API

Send SMS via HTTP POST with a JSON body. Set header Content-Type: application/json.

POST https://www.smsgatewayhub.com/api/mt/SendSMS

Request Body

{
  "Account": {
    "APIkey": "your-api-key",
    "SenderId": "TESTIN",
    "Channel": "2",
    "DCS": "0",
    "SchedTime": null,
    "GroupId": null,
    "EntityId": "your-entity-id"
  },
  "Messages": [
    {
      "Text": "Your message here",
      "DLTTemplateId": "your-template-id",
      "Number": "91989xxxxxxx"
    }
  ]
}
POST

XML API

Send SMS via HTTP POST with an XML body. Set header Content-Type: application/xml.

POST https://www.smsgatewayhub.com/api/mt/SendSMS

Request Body

<SmsQueue>
  <Account>
    <APIKey>your-api-key</APIKey>
    <SenderId>TESTIN</SenderId>
    <Channel>2</Channel>
    <EntityId>13011xxxxxxxx</EntityId>
    <DCS>0</DCS>
    <FlashSms>0</FlashSms>
    <Route>1</Route>
  </Account>
  <Messages>
    <Message>
      <Number>91989xxxxxxx</Number>
      <Text>Your message here</Text>
      <DltTemplateId>130716xxxxxxxxx</DltTemplateId>
    </Message>
  </Messages>
</SmsQueue>
POST

Simple Voice SMS API

Send a text-to-speech (TTS) voice call to a single recipient. Supports Indian English and Hindi voices.

POST https://vapi.smsgatewayhub.com/tts/3/single
🔐 Authorization: Basic base64(username:password) — pass in the Authorization header.

Parameters

ParameterTypeDescription
fromrequiredstringCaller ID in E.164 format (e.g. 919999999999)
torequiredstringDestination number in E.164 format
textstringTTS message text (up to 1400 characters)
languagestringLanguage code — default: en. See Voice Languages section.
voice.namestringVoice name (e.g. Joanna, Aditi, Ravi, Heera)
voice.genderstringmale or female
audioFileUrlstringURL to audio file (wav/mp3/ogg, max 4 MB). Use instead of text.

Request Examples

{
  "from": "919999999999",
  "to": "916666666666",
  "text": "Test Voice message.",
  "language": "en",
  "voice": { "name": "Joanna", "gender": "female" }
}

Response

{"messages":[{
  "to": "916666666666",
  "status": {
    "groupId": 1,
    "groupName": "PENDING",
    "id": 7,
    "name": "PENDING_ENROUTE",
    "description": "Message sent to next instance"
  },
  "messageId": "2250be2d4219-3af1-78856-aabe-1362af1edfd2"
}]}
POST

Multiple Voice SMS API

Send voice messages to multiple recipients. Mix TTS text and audio file URLs within the same request batch.

POST https://vapi.smsgatewayhub.com/tts/3/multi

Request Body

{
  "messages": [
    {
      "from": "919999999999",
      "to": ["916666666666", "919999999998"],
      "audioFileUrl": "https://www.example.com/media.mp3"
    },
    {
      "from": "919999999999",
      "to": ["916666666666"],
      "text": "Hello world!",
      "language": "en",
      "voice": { "name": "Joanna", "gender": "female" }
    }
  ]
}
POST

Fully Featured Voice API

Full-featured voice API with scheduling, DTMF input, call transfer, retry logic, machine detection, recording, and delivery webhooks.

POST https://vapi.smsgatewayhub.com/tts/3/advanced

Key Additional Parameters

ParameterTypeDescription
bulkIdstringUnique identifier for the bulk request
speechRatedoublePlayback speed — range 0.5 to 2.0 (default: 1)
notifyUrlstringWebhook URL for delivery report callbacks
validityPeriodintMessage validity in minutes (max 48 hours = 2880)
sendAtdatetimeScheduled send time in ISO 8601 format
recordbooleanRecord the call — true or false
repeatDtmfstringDTMF code that triggers message repeat
ringTimeoutintRing duration before hang-up in seconds (default: 45, max: 45)
machineDetectionstringhangup — hang up on machine; continue — play into voicemail
retry.minPeriodintMinimum retry wait in minutes
retry.maxPeriodintMaximum retry wait in minutes
retry.maxCountintMax retry attempts (maximum: 4)
⚠️ Machine detection is charged additionally. Contact your account manager for pricing.

Call Transfer — Any DTMF

[{ "if": "anyDtmf", "transferTo": "919999999999", "callTransferMaxDuration": 10 }]

Call Transfer — Specific DTMF Keys

[
  { "if": "dtmf", "equals": "1", "transferTo": "919999999999" },
  { "if": "dtmf", "equals": "2", "transferTo": "919999999998" }
]
💡 Add pauses between words using commas in the text field. Each comma = 0.5 seconds pause. Example: "one,,,,two,,,,three"
GET

Voice Delivery Reports

🔴 Delivery reports are returned ONCE only. Subsequent calls return an empty collection.
GET https://vapi.smsgatewayhub.com/tts/3/reports
ParameterTypeDescription
bulkIdstringFilter by bulk request ID
messageIdstringFilter by specific message ID
limitintMaximum number of reports to return (default: 50)

Missed Call API

When an incoming missed call arrives at your toll-free or DID number, SMSGatewayHub forwards the call details to your webhook URL via GET request.

WEBHOOK http://yoursite.com/handler.php?who=%who&ChannelID=%channel&Circle=%circle&Operator=%operator&DateTime=%time

Parameters Forwarded to Your Webhook

ParameterDescription
CallerPhone number of the caller
ChannelYour toll-free or DID number that received the call
CircleTelecom circle of the caller
OperatorCaller's mobile operator (Jio, Airtel, Vi, BSNL, etc.)
CallTimeDate and time the call was received
⚠️ Your webhook must respond quickly. Do not return any HTML in the response body — plain text or JSON only.

PHP Sample

Quick-start PHP implementation using cURL. Copy and paste, replace your credentials, and you're ready to go.

<?php
$apikey = "YourAPIkey";
$sender = "TESTIN";
$msg    = "YOUR MESSAGE HERE";
$num    = "91XXXXXXXXX";

// URL-encode the message to handle special characters
$ms = rawurlencode($msg);

$url = "https://www.smsgatewayhub.com/api/mt/SendSMS"
     . "?APIKey=$apikey"
     . "&senderid=$sender"
     . "&channel=2"
     . "&DCS=0"
     . "&flashsms=0"
     . "&number=$num"
     . "&text=$ms"
     . "&route=1";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
if ($result['ErrorCode'] === '000') {
    echo "SMS sent! Job ID: " . $result['JobId'];
} else {
    echo "Error: " . $result['ErrorMessage'];
}
?>

API Response Error Codes

Error CodeDescription
000Success
001Login details cannot be blank
003Sender ID cannot be blank
004Message text cannot be blank
005Message data cannot be blank
006Generic error
007Username or password is invalid
008Account not active
009Account locked — contact your account manager
0010API restriction
0011IP address restriction
0012Invalid message length
0013Mobile numbers not valid
0014Account locked due to spam — contact support
0015Sender ID not valid
0017Group ID not valid
0018Multi-message to group is not supported
0019Schedule date is not valid
0020Message or mobile number cannot be blank
0021Insufficient credits
0022Invalid Job ID
0023Parameter missing
0024Invalid template or template mismatch
0025{Field} cannot be blank or empty
0026Invalid date range
0027Invalid optin user

Special Character Encoding

URL-encode these characters when passing them in query string parameters (especially in the text field). Use PHP's rawurlencode() or JavaScript's encodeURIComponent() to handle this automatically.

space%20
!%21
"%22
#%23
$%24
%%25
&%26
'%27
(%28
)%29
*%2A
+%2B
,%2C
-%2D
.%2E
/%2F
:%3A
;%3B
<%3C
=%3D
>%3E
?%3F
@%40
[%5B
\%5C
]%5D
^%5E
`%60
{%7B
|%7C
}%7D
~%7E

Voice Languages

English (Indian) en-in
Female:Aditi, Heera ✦, Priya, Raveena
Male:Ravi
Hindi hi
Female:Aadita ✦, Kalpana
Male:Hemant
English (US) en
Female:Joanna ✦, Salli, Kendra, Ivy
Male:Matthew, Justin
✦ = Default voice for language

Frequently Asked Questions

Common questions from developers integrating the SMSGatewayHub API. Click any question to expand the answer.

Register at smsgatewayhub.com, log in to your panel, and navigate to API Settings. Your unique APIKey will be displayed there. Use this key in every API request as the APIKey parameter. Keep it confidential — never expose it in client-side JavaScript.
DLT (Distributed Ledger Technology) is TRAI's mandatory registration system for all commercial SMS senders in India. Every SMS must include a EntityId (your company's registered DLT ID) and a dlttemplateid (the approved message template ID). Without these, telecom operators will block your messages. Register your entity and templates on the DLT portal of your preferred telecom operator (Jio, Airtel, Vi, BSNL).
Error 0024 means the message text you sent does not match the pattern of your DLT-registered template. Common causes: (1) Variable values contain characters not allowed in the template, (2) Extra spaces or punctuation differ from the approved template, (3) Wrong dlttemplateid used. Solution: compare your actual message text character-by-character with the approved template — the fixed text must match exactly, only the variable placeholders can differ.
Use channel=OTP in your API request. The endpoint remains the same: https://www.smsgatewayhub.com/api/mt/SendSMS. The OTP channel has the highest delivery priority and bypasses DND (Do Not Disturb) filters. You still need a DLT-registered OTP template and EntityId. Example:

...&channel=OTP&text=Your+OTP+is+123456&EntityId=XXX&dlttemplateid=YYY
Set DCS=8 in your API request to enable Unicode encoding. This supports Hindi, Marathi, Gujarati, Tamil, Telugu, Bengali and all other Indian languages. Important: Unicode SMS have a limit of 70 characters per SMS instead of the usual 160 characters for English. For multi-part Unicode SMS, each part can carry 67 characters. Always URL-encode your Unicode text before sending.
Transactional SMS (channel=2) — Used for alerts, notifications, OTPs, and account-related messages. Can be sent to DND numbers. Delivered 24×7.

Promotional SMS (channel=1) — Used for marketing, offers, and advertisements. Cannot be sent to DND numbers. Delivery restricted to 9 AM – 9 PM only.

Both require DLT-registered sender IDs and templates as per TRAI regulations.
Use the DLR (Delivery Report) API with the jobid returned in your send SMS response:

https://www.smsgatewayhub.com/api/mt/GetDelivery?APIKey=YOURKEY&jobid=JOBID

The response will show DeliveryStatus as Delivered, Pending, Failed, or NDNC for each mobile number in the batch.
Use PHP's cURL functions. Always use rawurlencode() on your message text to handle spaces and special characters. See the PHP Sample section above for complete code. Key points: set CURLOPT_SSL_VERIFYPEER to false if you face SSL issues in development (enable it in production), and parse the JSON response with json_decode() to check the ErrorCode field.
Yes. Set channel=INT and include the full number with country code (without the + prefix). For example, a US number: 12093158246, a UK number: 447911123456. The EntityId and dlttemplateid parameters are not required for international SMS. Contact support for international pricing before sending.
Flash SMS appears instantly as a popup on the recipient's screen without being saved to their inbox. Set flashsms=1 to send flash SMS. Best use cases: urgent OTPs where you want the code to disappear after viewing, emergency alerts, and time-sensitive notifications. Note: not all devices and operators support flash SMS equally — use standard SMS (flashsms=0) for maximum compatibility.
Add the schedtime parameter in the format yyyy/mm/dd hh:mm:ss AM/PM. Example:

&schedtime=2025/12/31+10:30:00+AM

The message will be queued and delivered at the specified time. You can schedule bulk SMS campaigns in advance using this feature. To cancel a scheduled SMS, contact support with the jobid.
Log in to your SMSGatewayHub panel and go to Account Settings → API Security. Add your server's IP address(es) to the whitelist. Once enabled, API requests from any other IP will receive error code 0011 (IP address restriction). This is strongly recommended for production environments to prevent unauthorized use of your API key.
Standard accounts support up to 200 requests per second (RPS) with 100–500ms response times. For high-volume requirements, the HA (High Availability) Cluster supports 2000 transactions per second (TPS) with 50–150ms response times. To upgrade, contact support@smsgatewayhub.com with your expected daily volume.
Two options: (1) Comma-separated numbers — pass multiple numbers in the number parameter separated by commas. (2) Contact Group — create a contact group in your panel, note the Group ID, and pass it in the groupid parameter. The group method is easier for recurring campaigns where the recipient list doesn't change.